<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/view/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">      	
  	  <link rel="stylesheet" type="text/css" href="./estilos.css"/>
  	  
<h:form id="formManterMatricula" prependId="false">  
	<p:panel id="panelManterMatricula" header="Manter Matricula" style="margin-bottom:20px; ">  
	<f:facet name="header">
		<h:outputText value="Manter Matricula" styleClass="outputTextTitulo"/>
	</f:facet>
 	<p:messages id="messages" autoUpdate="true" closable="true" /> 
    	<h:panelGrid id="pgMatricula" columns="4" style="margin-top:20px; margin-right:10%; margin-bottom:15px;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Código*" styleClass="outputLabel"/> 
            <h:outputLabel value="Aluno*" styleClass="outputLabel"/>   
            <h:outputLabel />           
            <p:inputText value="#{matriculaBean.matricula.idMatricula}" styleClass="inputId" disabled="true"/>  
  			<p:inputText value="#{matriculaBean.matricula.aluno.idAluno}"  styleClass="inputId" >
  				<f:convertNumber type="number"/>
  			</p:inputText>  
  			<p:inputText value="#{matriculaBean.matricula.aluno.nome}" maxlength="40" styleClass="inputDescricao" /> 
  			<p:commandButton icon="ui-icon-search" actionListener="#{matriculaBean.openDialogConsultarAluno}" immediate="true"/>
	    </h:panelGrid> 
    	
		<p:fieldset legend="Informações do Plano" >  
    		<h:panelGrid id="pgPlano" columns="3">  
            	<h:outputLabel value="Código*" styleClass="outputLabel"/> 
            	<h:outputLabel value="Plano*" styleClass="outputLabel"/>   
            	<h:outputLabel />           
            	<p:inputText value="#{matriculaBean.matricula.plano.idPlano}" styleClass="inputId" disabled="true"/>  
  				<p:inputText value="#{matriculaBean.matricula.plano.descricao}"  styleClass="inputDescricao" disabled="true"/> 
  				<p:commandButton icon="ui-icon-search" actionListener="#{matriculaBean.openDialogConsultarPlano}" />
    		</h:panelGrid>  
    		<p:dataTable  id="tablePlanoModalidade" value="#{matriculaBean.listPlanoModalidade}" var="planoModalidade" style="margin-top:30px; width:40%">        				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Modalidade" />
					</f:facet>
					<h:outputText value="#{planoModalidade.modalidade.descricao}" />
				</p:column>
				<p:column style="text-align:center">
					<f:facet name="header">
						<h:outputText value="Valor" />
					</f:facet>
					<h:outputText value="#{planoModalidade.valor}" >
						<f:convertNumber type="currency" currencySymbol="R$ "/>
					</h:outputText>
				</p:column>      
    	    </p:dataTable>
    		<h:panelGrid id="pgPeriodo" columns="4">  
            	<h:outputLabel value="Período" styleClass="outputLabel"/> 
            	<h:outputLabel value="Meses" styleClass="outputLabel"/>   
            	<h:outputLabel value="Condição de Pagamento" styleClass="outputLabel"/>
            	<h:outputLabel value="Total" styleClass="outputLabel"/>           
            	<p:inputText value="#{matriculaBean.matricula.plano.periodo.descricao}" style="width:200px" styleClass="inputDescricao" disabled="true"/>  
            	<p:inputText value="#{matriculaBean.matricula.plano.periodo.meses}" styleClass="inputId" disabled="true"/>  
  				<p:inputText value="#{matriculaBean.matricula.plano.condicaoPagamento.descricao}" style="width:200px" styleClass="inputId" disabled="true"/> 
  				<p:inputText value="#{matriculaBean.matricula.plano.total}" styleClass="inputId" disabled="true">
  					<f:convertNumber type="currency" currencySymbol="R$" maxFractionDigits="2" minFractionDigits="2"/>
  				</p:inputText> 
    		</h:panelGrid>  
    		<p:dataTable  id="tableContasReceber" value="#{matriculaBean.listContaReceber}" var="contaReceber" style="margin-top:30px; width:20%">        				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Data de Vencimento" />
					</f:facet>
					<h:outputText value="#{contaReceber.dtVencimento}" >
						<f:convertDateTime dateStyle="medium"/>
					</h:outputText>
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="Valor" />
					</f:facet>
					<h:outputText value="#{contaReceber.valor}" >
						<f:convertNumber type="currency" currencySymbol="R$" maxFractionDigits="2" minFractionDigits="2"/>
					</h:outputText>
				</p:column>      
    	    </p:dataTable>
		</p:fieldset>  
        <h:panelGrid id="pgData" columns="2">  
            	<h:outputLabel value="Data da Matrícula" styleClass="outputLabel"/> 
            	<h:outputLabel value="Data Final" styleClass="outputLabel"/>   
            	<p:inputText value="#{matriculaBean.matricula.dtMatricula}" styleClass="inputData" disabled="true">
            		<f:convertDateTime dateStyle="medium"/>
            	</p:inputText>  
  				<p:inputText value="#{matriculaBean.matricula.dtFinal}"  styleClass="inputData" disabled="true">
  					<f:convertDateTime dateStyle="medium"/>
  				</p:inputText> 
    		</h:panelGrid> 
    </p:panel>  
    <p:commandButton value="Salvar" action="#{matriculaBean.saveMatricula}" update="panelManterMatricula, messages" style="margin-right:20px; margin-left:10px;" /> 
	<p:commandButton value="Voltar" action="#{matriculaBean.consultarMatricula}" immediate="true" style="margin-right:20px;" /> 
</h:form>  	
<ui:include src="/view/matricula/dialogConsultarAluno.xhtml"></ui:include>
<ui:include src="/view/matricula/dialogConsultarPlano.xhtml"></ui:include>

</ui:define>
</ui:composition>
